//
//  HYWeibo.m
//  HY-11weibo
//
//  Created by iOSzhb on 15/8/3.
//  Copyright (c) 2015年 恒昌利通. All rights reserved.
//

#import "HYWeibo.h"

@implementation HYWeibo

- (instancetype)initWithDict:(NSDictionary *)dict
{
    self = [super init];
    if (self != nil) {
        [self setValuesForKeysWithDictionary:dict];
    }
    return self;
}

+ (instancetype)weiboWithDict:(NSDictionary *)dict
{
    return [[self alloc] initWithDict:dict];
}

/** 提供给一个方法，将自身对象存放到一个数组中返回 */
+ (NSMutableArray *)weiboArray
{
    NSMutableArray *modelArray = [NSMutableArray array];
    
    NSString *path = [[NSBundle mainBundle] pathForResource:@"weibo" ofType:@"plist"];
    NSArray *array = [NSArray arrayWithContentsOfFile:path];
    for (NSDictionary *dict in array) {
        HYWeibo *model = [self weiboWithDict:dict];
        [modelArray addObject:model];
    }
    return modelArray;
}


@end
